package engine

import (
	"go-reptile/crawler/fetcher"
	"log"
)

func  worker(r Request) (ParserResult,error){
	body, err := fetcher.Fetch(r.Url)
	if err != nil {
		log.Printf("编码转换失败, %s : %v",r.Url,err)
		return ParserResult{},err
	}
	return r.ParserFunc(body,r.Url),nil
}
